package PTA;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main1 {
	public static void main(String[] args) {
		Set<String> word=new TreeSet<>();
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		while(!s.equals("!!!!!"))
		{
				word.add(s);
				s=sc.next();
		}
		System.out.println(word.size());
		int i=0;
		for (String e : word) {
			if(i<10)
				System.out.println(e);
			i++;
		}
	}
}
